$(document).ready(function () {
	$(document).keypress(function (e) {
		key = (e.keyCode) ? e.keyCode : e.which;
		if (key === 13) {
			$('form').submit();
		}
	});
	
});

var process = function(data, target) {
	if (data.deleted == false) {
		$('#documentresponse').html(data.message);
    }
    else {
    	//add message
		$('#person-form').html('<p align="center">' + data.message + '</p>');
		$('#submitter').fadeOut(function () {
			$('.info').remove();
			$(this).remove();
			//create button
	    	jQuery('#cancel').val(JAVASCRIPT_CLOSE_WINDOW);
			$('#documentresponse').empty();
		});
	}
};